package com.raccoonagents.tools.cascet2d.model.stage;

import com.raccoonagents.tools.cascet2d.interfaces.IGraphicContainer;
import com.raccoonagents.tools.cascet2d.interfaces.rendering.IMaskedTexturedRenderable;
import com.raccoonagents.tools.cascet2d.model.Vector2f;
import com.raccoonagents.tools.cascet2d.util.GraphicUtil;

public class TexturedWindow extends PlainWindow implements IMaskedTexturedRenderable{

	protected int mask;
	protected int image;
	
	public TexturedWindow(final IGraphicContainer parent, final Vector2f size, final Vector2f location, final int image, final int mask) {
		super(parent, size, location);
		this.image = image;
		this.mask = mask;
	}

	@Override
	public int getMaskImage() {
		return mask;
	}

	@Override
	public int getTexture() {
		return image;
	}

	@Override
	public void render() {
		if(visible){
			GraphicUtil.renderMaskedImage(this);			
			super.render();
		}
	}
	
}
